From: Colin Walters Date: Tue, 1 Nov 2016 18:17:57 +0000 (-0400) Subject: repo: Don't put remote refs in the summary file X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~44^2~11 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=730f7238699b932c90423a63c6720a12643a76b2;p=ostree.git repo: Don't put remote refs in the summary file I was doing a chain of mirroring like A -> B -> C And repo B had A as a remote. When I added B as a remote to C, the summary file of B had a ref upstream:foo/bar/baz, which caused all pulls from B to C to fail, since the summary file is only expected to have refs, not refspecs. Closes: https://github.com/ostreedev/ostree/issues/561 Closes: #565 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 1f866bbe..ad629421 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -4668,10 +4668,18 @@ ostree_repo_regenerate_summary (OstreeRepo *self, { const char *ref = iter->data; const char *commit = g_hash_table_lookup (refs, ref); + g_autofree char *remotename = NULL; g_autoptr(GVariant) commit_obj = NULL; g_assert (commit); + if (!ostree_parse_refspec (ref, &remotename, NULL, NULL)) + g_assert_not_reached (); + + /* Don't put remote refs in the summary */ + if (remotename != NULL) + continue; + if (!ostree_repo_load_variant (self, OSTREE_OBJECT_TYPE_COMMIT, commit, &commit_obj, error)) goto out;